import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeUnit;

import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

//import com.sun.jna.platform.FileUtils;


public class screenshoots {

	@Test
	
	public void myscreenshots() throws IOException{
		WebDriver myFD = new FirefoxDriver();
		
		myFD.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
		myFD.navigate().to("http://www.google.com");
		File file= ((TakesScreenshot)myFD).getScreenshotAs(OutputType.FILE);
		FileUtils.copyFile(file, new File("D:\\Screenshots\\Sshot1.png"));
		myFD.quit();
}
}